public class demo1 {
    public static void main(String[] args) {
        int[] arry1 = {1,2,3,4,5,6,7,8,9};
        int[] newArry1 = copyArry(arry1,3,7);
        for (int i = 0; i < newArry1.length; i++) {
            System.out.println(newArry1[i]);
        }
    }
    public static int[] copyArry(int[] arry,int start,int end){
        int[] newArry = new int[end - start];
        int index = 0;
        for (int i = start; i < end; i++) {
            newArry[index] = arry[i];
            index++;
        }
        return newArry;
    }
}
